package com.gitee.ywj1352.mybatis;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/**
 * @author  wenjie.yang on 2019/4/16.
 *
 * 主要是 代理testMapper  根据方法名在 sqlsession中找到 sql语句
 */
public class MapperProxy implements InvocationHandler{
    private Sqlsession sqlsession;

    public MapperProxy(Sqlsession sqlsession) {
        this.sqlsession = sqlsession;
    }


    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        sqlsession.selelctOne();
        return null;
    }
}
